package com.greatchn.author_code.web.srv;

import com.greatchn.author_code.web.po.UserInfo;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @UserInfoSrv: 系统用户
 * @author: ZBoHang
 * @time: 2023/2/8 10:28
 */
@Service
public class UserInfoSrv {

    public static final Map<String, UserInfo> map;

    static {
        map = new HashMap<String, UserInfo>() {
            {
                put("admin", new UserInfo().setId("1").setUserName("admin").setPassWord("123456").setRole("ADMIN,USER"));
                put("user", new UserInfo().setId("1").setUserName("user").setPassWord("123456").setRole("USER"));
            }
        };
    }

    public UserInfo findUserByUserName(String userName) {
        // TODO: 2023/2/8
        return map.get(userName);
    }
}
